import { RouteRecordRaw } from 'vue-router'
export const Layout = () => import('@/layouts/index.vue')

// 公共路由
export const constantRoutes: RouteRecordRaw[] = [
  {
    path: '/login',
    meta: { alwaysShow: false, hidden: true },
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/redirect',
    component: Layout,
    name: 'Redirect',
    children: [
      {
        path: '/redirect/:path(.*)',
        name: 'RedirectIndex',
        component: () => import('@/views/Redirect/index.vue'),
        meta: {}
      }
    ],
    meta: {
      hidden: true,
      noTagsView: true
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      title: '404页面',
      hidden: true
    }
  },
  {
    path: '/',
    name: '/',
    component: Layout,
    redirect: '/home',
    meta: { alwaysShow: false, hidden: false, title: '首页', icon: 'setting' },
    children: [
      {
        path: 'home',
        name: 'Home',
        meta: { alwaysShow: false, hidden: false, title: '首页', icon: 'setting', keepAlive: true, full: false, affix: true, link: null },
        component: () => import('@/views/home/index.vue')
      }
    ]
  }
]

// 公共路由
export const dynamicRoutes: RouteRecordRaw[] = [
  {
    path: '',
    component: Layout,
    meta: { alwaysShow: false, hidden: false, title: '测试管理', icon: '', noCache: true, full: false, affix: false, link: null },
    children: [
      {
        path: '/test',
        name: 'test',
        meta: { alwaysShow: false, hidden: false, title: '测试', icon: '', noCache: true, full: false, affix: false, link: null },
        component: () => import('@/views/test/index.vue')
      }
    ]
  }
]
